package com.passcheck.controller;

import com.passcheck.anno.ResponseResultBody;
import com.service.config.GetConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ZhangHaiWen
 * @title: GetConfigController
 * @projectName minipasscheck
 * @description: 获取秘钥参数 客户端获取服务端部分配置 信息
 * @date 2021/2/516:50
 */

@ResponseResultBody
@RestController
@RequestMapping(value = "/config")
public class GetConfigController {

    @Autowired
    private GetConfigService getConfigService;

    /**
 　　* @description: aes
 　　* @param
 　　* @return {@link Object}
 　　* @throws
 　　* @author ZhangHaiWen
 　　* @version 2.0
 　　* @date 2020/12/17 9:01
 　　*/
    @RequestMapping(value = "/aeskey",method = RequestMethod.POST)
    public Object getAeskey(){
        return getConfigService.getAeskey();
    }

    /**
     　　* @description: 获取rsa秘钥，根据res秘钥加密，获取私钥和公钥
     　　* @param
     　　* @return {@link Object}
     　　* @throws
     　　* @author ZhangHaiWen
     　　* @version 2.0
     　　* @date 2020/12/17 9:01
     　　*/
    @RequestMapping(value = "/miniKeyAndSysPubKey",method = RequestMethod.POST)
    public Object login(){
        return getConfigService.getMiniKeyAndSysPubKey();
    }
}
